<style type="text/css">
	#con{
		padding: 20px;
	}
	#functionItem{
		height: 32px;
		line-height: 32px;
		font-size: 12px;
	}
	#functionItem a{
		display: inline-block;
		height: 32px;
		line-height: 32px;
		text-align: center;
		width: 92px;
		border-radius: 20px;
		color: #fff;
		margin-right: 11px;
	}
	#functionItem span{
		color: red;
	}
	.add{
		background: #408080;
	}
	.del{
		background:#d15967;
	}
	#table{
		width: 100%;
		border-left: 1px solid #e8e8e8;
		border-right: 1px solid #e8e8e8;
		margin-top: 20px;
	}
	#table tr:hover{
		background: #E4EFFF;
	}
	#table th{
		text-align: center;
		background: #f4f4f4;
		height: 50px;
		border-top: 1px dashed #e8e8e8;
		border-bottom: 1px dashed #e8e8e8;
		font-size: 14px;
		color: #333;
	}
	#table td{
		text-align: center;
		height: 50px;
		border-bottom: 1px solid #e8e8e8;
		font-size: 12px;
		color: #333 ;
	}
	#table td a{
		display: inline-block;
		width: 70px;
		height: 30px;
		border: 1px solid #e8e8e8;
		border-radius: 15px;
		text-align: center;
		line-height: 30px;
		font-size: 12px;
		color: #666;
		margin-right: 16px;
	}
	#table td a:last-child{
		margin-right: 0;
	}
	#table td a:hover{
		background: #408080;
		color: #fff;
		transition: all .2s linear;
	}
	#table td .del1:hover{
		transition: all .2s linear;
		background: #d15967;
	}
	#ue_mask{
		position: fixed;
		top:0;
		left:0;
		width: 100% !important;
		height: 100%;
		background: rgba(0,0,0,.2);
	}
</style>
<div id="con">
	#if(a==1||a==5||a==6||a==7||a==8||a==9)
	<div id="functionItem">
		<a  ue_href="../admin/add?id=#(id??)" isHasUeditor="true" class="add" >新增</a></a>记录数：<span>#(size??)&nbsp;</span>识别码：<td class="u_id">#(id??)</td>
	</div>
	#elseif(a==2||a==3||a==4)
	<div id="functionItem">
		<a  ue_href="../admin/add?id=#(id??)" isHasUeditor="false" class="add" >新增</a></a>记录数：<span>#(size??)&nbsp;</span>识别码：<td class="u_id">#(id??)</td>
	</div>
	#end
	<div>
		<table id="table" border="0" cellspacing="0" cellpadding="0">
			#if(a==1)
			<tr>
				<th>序号</th>
				<th>渠道名称</th>
				<th>贷款额度</th>
				<th>贷款利率</th>
				<th>批款速度</th>
				<th>创建时间</th>
				<th>贷款期限</th>
				<th>还款方式</th>
				<th>产品类型</th>
				<th>图标</th>
				<th>操作</th>
			</tr>
			#for(li : list)
			<tr>
				<td class="id">#(li.id??)</td>
				<td>#(li.image_name??)</td>
				<td>#(li.limit??)</td>
				<td>#(li.interest??)</td>
				<td>#(li.speed??)</td>
				<td>#(li.date??)</td>
				<td>#(li.deadline??)</td>
				<td>#(li.repayment??)</td>
				<td>#(li.product??)</td>
				<td><img src="#(li.image)" height="50" width="70"></td>
				<td><a class="kill" ue_href="../admin/check?id=#(li.id??)&u_id=#(id??)" >查看</a><a ue_href="../admin/compile?id=#(li.id??)&u_id=#(id??)" isHasUeditor="true" class="edit">编辑</a><a class="del1">删除</a></td>

			</tr>
			#end
			#elseif(a==2||a==5||a==6||a==7||a==8||a==9)
			<tr>
				<th>序号</th>
				<th>文章头部</th>
				<th>文章配图</th>
				<th>时间</th>
				<th>操作</th>
			</tr>
			#for(li : list)
			<tr>
				<td class="id">#(li.id??)</td>
				<td>#(li.headline??)</td>
				#if(li.img??)
				<td><img src="#(li.img??)" height="60" width="100"></td>
				#else
				<td>暂无图片~</td>
				#end
				<td>#(li.date??)</td>
				<td><a class="kill" ue_href="../admin/check?id=#(li.id??)&u_id=#(id??)" >查看</a><a ue_href="../admin/content?id=#(li.id??)&u_id=#(id??)" isHasUeditor="true" class="edit">编辑</a><a class="del1">删除</a></td>
			</tr>
			#end
			#elseif(a==3)
			<tr>
				<th>序号</th>
				<th>图片</th>
				<th>链接</th>
				<th>时间</th>
				<th>操作</th>
			</tr>
			#for(li : list)
			<tr>
				<td class="id">#(li.id??)</td>
				<td><img src="#(li.image??)" height="100" width="500"></td>
				<td>#(li.link??)</td>
				<td>#(li.date??)</td>
				<td><a class="kill" ue_href="../admin/check?id=#(li.id??)&u_id=#(id??)">查看</a><a ue_href="../admin/content?id=#(li.id??)&u_id=#(id??)" isHasUeditor="false" class="edit">编辑</a><a class="del1">删除</a></td>
			</tr>
			#end
			#elseif(a==4)
			<tr>
				<th>序号</th>
				<th>图片</th>
				<th>图片描述</th>
				<th>链接</th>
				<th>时间</th>
				<th>操作</th>
			</tr>
			#for(li : list)
			<tr>
				<td class="id">#(li.id??)</td>
				<td><img src="#(li.image??)" height="80" width="320"></td>
				<td>#(li.title??)</td>
				<td>#(li.link??)</td>
				<td>#(li.date??)</td>
				<td><a class="kill" ue_href="../admin/check?id=#(li.id??)&u_id=#(id??)">查看</a><a ue_href="../admin/content?id=#(li.id??)&u_id=#(id??)" isHasUeditor="false" class="edit">编辑</a><a class="del1">删除</a></td>
			</tr>
			#end
			#end
		</table>
	</div>
</div>

<script>

    $(".del1").click(function () {
        var index=$(".del1").index($(this));
        var id=$('.id').eq(index).text();
        var u_id=$('.u_id').text();
        $.messager.confirm('提示', '确定要删除吗？', function (r) {
            if (r) {
                $.ajax({
                    url:"delete",
                    type:"post", //请求方式 post get
                    data: {
                        id: id,     //用户的openid
                        u_id:"#(id??)",  //数据库识别码
                    },
                    success:function(data){
                    }
                });
                $(".del1").eq(index).parent().parent().remove();
                $("#ue_mask").window('close');
                $("#dialog").dialog('close');
                /*console.log("确定")*/
            }else{
                /*console.log("取消")*/
            }
        });
    })

    $(".edit").click(function(){
        var index=$(".edit").index($(this));
        $.system.formdialog({
            title: '编辑',
            href: $(".edit").eq(index).attr("ue_href"),
            width: 1000,
			/*queryParams: {
			 id: id
			 },*/
            success: function () {
				/*$.crm.biz.dg.datagrid('reload');*/
            },
            onDestroy: function () {
                //销毁表单中的富文本编辑框，否则下次调用会不渲染
				if($(".edit").eq(index).attr("isHasUeditor")=="true"){
                    UE.getEditor('container',{
                        toolbars:[]
                    }).destroy();
				}
            },
        });


    })
    $(".add").click(function(){
        var index=$(".add").index($(this));
        $.system.formdialog({
            title: '新增',
            href: $(".add").attr("ue_href"),
            width: 1000,
			/*queryParams: {
			 id: id
			 },*/
            success: function () {
				$("#table").datagrid('reload');
            },
            onDestroy: function () {
                //销毁表单中的富文本编辑框，否则下次调用会不渲染
                if($(".add").eq(index).attr("isHasUeditor")=="true"){
                    UE.getEditor('container',{
                        toolbars:[]
                    }).destroy();
                }
            },
        });
    })
    $(".kill").click(function() {
        var index = $(".kill").index($(this));
        $.system.viewdialog({
            title: '查看',
            href: $(".kill").eq(index).attr("ue_href"),
            width: 1000,
        });
    })
</script>